<!doctype html>
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
         language="java" %>
<%@ include file="/jsp/mobile/include/include.jsp" %>
<%
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragrma", "no-cache");
    response.setDateHeader("Expires", 0);
%>
<html lang="cn">
<head>
    <%@ include file="/jsp/mobile/include/header.jsp" %>
    <title>在线充值</title>
</head>
<style type="text/css">
    input::-ms-input-placeholder {
        text-align: left;
    }

    input::-webkit-input-placeholder {
        text-align: left;
    }
</style>
<body class="nobg">
<input type="hidden" id="returnUrl" name="returnUrl" value="javascript:window.jsInjectedObj.goBackMain();"/>

<div class="main">
    <form id="nocardIncomeForm"
          action="<%=request.getContextPath()%>/mobile/index/nocarddeal">
        <div class="inTpx">
            <div class="itx">
                <span class="iTi">金额</span>
                <input name="incomeAmt" id="incomeAmt" type="text" class="text" placeholder="金额不少于10元">
            </div>
            <div class="itx mt15">
                <span class="iTi">卡号</span>
                <input name="incomeCardNo" id="incomeCardNo" type="text" class="text" placeholder="输入信用卡或储蓄卡卡号">
                <c:choose>
                    <c:when test="${fn:length(list)>0}">
                        <i class="icov icov6" onclick="selectpaycard();"></i>
                    </c:when>
                    <c:otherwise>
                        <i class="icov icov7"></i>
                    </c:otherwise>
                </c:choose>

            </div>
            <div class="mt20">
                <a id="confirmAmt" href="javascript:income();"
                						class="butn butn-gray">确定</a>
            </div>
            <div class="mt20">
                <p>温馨提示：</p>

                <div class="mt5 gray9">
                    <p>1.支持信用卡和储蓄卡（<a href="<%=request.getContextPath()%>/mobile/index/nocardlimit"
                                      class="red underline">银行列表</a>），无需开通网银; </p>

                    <p>2.支付限额：支付限额：单笔20000元，单日30000元; </p>

                    <p>3.支付手续费：0.5%</p>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        changeStyleByValue();
    });
    function selectpaycard() {
        var _incomeAmt = $("#incomeAmt").val();
        if(_incomeAmt<10){
            $(this).attr("placeholder", "金额不少于10元");
            return;
        }
        window.location.href = "<%=request.getContextPath()%>/mobile/index/historypaycard?transAmt=" + _incomeAmt;
    }

    function income() {
        $("#nocardIncomeForm").submit();
    }
    $("#incomeAmt").bind("focus", function () {
        $(this).removeAttr("placeholder");
    });

    $("#incomeAmt").bind("blur", function () {
        if ($(this).val()<10){
            $(this).attr("placeholder", "金额不少于10元");
        }
    });
    $("#incomeCardNo").bind("focus", function () {
        $(this).removeAttr("placeholder");
    });

    $("#incomeCardNo").bind("blur", function () {
        if ($(this).val() == '') {
            $(this).attr("placeholder", "输入信用卡或储蓄卡卡号");
        }
    });
    $("#incomeAmt").bind("input propertychange", function () {
        //这里写当input的文字(text)发生改变时所执行的代码！
        changeStyleByValue();
    });

    $("#incomeCardNo").bind("input propertychange", function () {
        //这里写当input的文字(text)发生改变时所执行的代码！
        changeStyleByValue();
    });

    function changeStyleByValue() {
        var _amt = $("#incomeAmt").val();
        var _cardNo = $("#incomeCardNo").val();
        if (checkPrice(_amt) && parseFloat(_amt) > 0 && cardNoCheck(_cardNo)) {
            $("#confirmAmt").removeClass("butn-gray").attr("href",
                    "javascript:income();");
        } else {
            $("#confirmAmt").addClass("butn-gray").removeAttr("href");
        }
    }
</script>
</html>